class Solution {
private:
	int nums[26]; 
public:
    bool areOccurrencesEqual(string s) {
        memset(nums, 0, sizeof(nums));
        for(int i = 0; i < s.length(); i++)nums[s[i] - 'a']++;
        int ans = 0;
        for(int i = 0; i < 26; i++){
        	if(!ans && nums[i])ans = nums[i];
        	if(ans && nums[i] && nums[i] != ans)return false;
		}
		return true;
    }
};
